<?PHP
class tagOption extends tagControl
{
	var $value = "";
	var $text = "";
	var $Selected = false;

	function tagOption($attrs = array())
	{
		parent::tagControl($attrs);
		if ( isset($this->attributes['value']) )
		{
			$this->value = $this->attributes['value'];
		}
		if ( isset($this->attributes['selected']) )
		{
			$this->selected = true;
		}
	}
	function Render($writer)
	{
		$writer->Write("<option");
		if ( !empty($this->value) )
		{
			$writer->Write(" value=\"$this->value\"");
		}
		if ( $this->Selected )
		{
			$writer->Write(" selected=\"selected\"");
		}
		else if ( !empty($this->attributes['selected']) )
		{
			$writer->Write(" selected=\"selected\"");
		}
		$writer->Write(">$this->text</option>\n");
	}
}
?>
